package com.sixteen.ordering_system.mapper;

import com.sixteen.ordering_system.pojo.Dish;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sixteen.ordering_system.pojo.DishCart;
import com.sixteen.ordering_system.pojo.SysOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.servlet.function.ServerResponse;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sixteen
 * @since 2022-09-16
 */
public interface DishMapper extends BaseMapper<Dish> {
    @Select("select * from  dish where dish_category_id=#{dish_category_id} and state = 1")
    List<Dish> selectCategory(@Param("dish_category_id") Integer dishCategoryId);
    @Select("select * from  dish where state = 1")
    List<Dish> selectCategoryall();
    @Select("select * from dish where dish_id=#{dishId}")
    List<Dish> shopAll(@Param("dish_id") Integer dishId);
    List<Dish> allDish();
    //    查询用户在购物车添加的某商品详情
    Dish selDish(Integer dishId);

//    添加菜品
    int addDish(Dish dish);

    Integer selectState(@Param("state") Integer state,
                        @Param("dish_id") Integer dishId);

}
